//
// Created by Semir on 2020/4/22.
//

#include <iostream>
#include <algorithm>

using namespace std;

struct Info {
    int id;
    int score;
};

const int MAX_N = 5005;
int n, m;
Info* vec[MAX_N];

bool cmp(Info *info1, Info *info2) {
    if (info1->score > info2->score) {
        return true;
    } else if (info1->score < info2->score) {
        return false;
    } else {
        return info1->id < info2->id;
    }
}

int main() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        vec[i] = new Info;
        cin >> vec[i]->id >> vec[i]->score;
    }
    sort(vec + 1, vec + n + 1, cmp);
    m *= 1.5;
    int line = vec[m]->score;
    int count = 0;
    for (int i = 1; i <= n; i++) {
        if (vec[i]->score >= line) {
            count++;
        }
    }
    cout << line << " " << count << endl;
    for (int i = 1; i <= count; i++) {
        cout << vec[i]->id << " " << vec[i]->score << endl;
    }
    return 0;
}